package com.artezio.vacation.domain;

import java.util.Date;

/**
 * Vacation
 */
public class Vacation {

    private long vacationId;
    private User user;
    private Date start;
    private Date end;
    private VacationStatus status;

    public long getVacationId() {
        return vacationId;
    }

    public void setVacationId(long vacationId) {
        this.vacationId = vacationId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public VacationStatus getStatus() {
        return status;
    }

    public void setStatus(VacationStatus status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Vacation vacation = (Vacation) o;

        if (vacationId != vacation.vacationId) return false;
        if (!end.equals(vacation.end)) return false;
        if (!start.equals(vacation.start)) return false;
        if (status != vacation.status) return false;
        if (!user.equals(vacation.user)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (vacationId ^ (vacationId >>> 32));
        result = 31 * result + user.hashCode();
        result = 31 * result + start.hashCode();
        result = 31 * result + end.hashCode();
        result = 31 * result + status.hashCode();
        return result;
    }
}
